package com.example.sp1.aaa;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

//@ConfigurationProperties表示使用bean对象读取配置项
//   prefix:表示配置文件中多个key的共同前缀（eg：app.name）
//@Service
@Configuration(proxyBeanMethods = false)
//@ConfigurationProperties(prefix = "app")

public class BB {

    //key的名称与属性名相同，调动属性setxxx方法给属性赋值
    //非static属性
    private String name;
    private String owner;
    private Integer port;


    public BB() {

    }

    public BB(String name, String owner, Integer port) {
        this.name = name;
        this.owner = owner;
        this.port = port;
    }

    /**
     * 获取
     * @return name
     */
    public String getName() {
        return name;
    }

    /**
     * 设置
     * @param name
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * 获取
     * @return owner
     */
    public String getOwner() {
        return owner;
    }

    /**
     * 设置
     * @param owner
     */
    public void setOwner(String owner) {
        this.owner = owner;
    }

    /**
     * 获取
     * @return port
     */
    public Integer getPort() {
        return port;
    }

    /**
     * 设置
     * @param port
     */
    public void setPort(Integer port) {
        this.port = port;
    }

    public String toString() {
        return "BB{name = " + name + ", owner = " + owner + ", port = " + port + "}";
    }
}
